package com.naiterui.ehp.bs.b2c.pharmacy.controller.inner;

import java.util.Date;
import java.util.List;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.naiterui.ehp.bs.b2c.pharmacy.service.IWarehouseSuperviseService;
import com.naiterui.ehp.bs.b2c.pharmacy.vo.SuperviseWarehouseVO;

import cn.hutool.core.date.DateUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @author luao
 * @date 2021/6/21 11:13 上午
 **/
@Slf4j
@RequestMapping("b2c/inner/warehouse/supervise")
@RestController
@RequiredArgsConstructor
public class WarehouseInnerSuperviseController {

    private final IWarehouseSuperviseService warehouseSuperviseService;

    @GetMapping
    public List<SuperviseWarehouseVO> warehouseList(String startDate, String endDate, Long warehouseId) {
        log.info("获取监管药店列表 startDate:{}, endDate:{}, warehouseId", startDate, endDate, warehouseId);
        Date start = DateUtil.parseDateTime(startDate).toJdkDate();
        Date end = DateUtil.parseDateTime(endDate).toJdkDate();
        return warehouseSuperviseService.warehouseList(start, end, warehouseId);
    }
}
